<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
    <title>悦章科技机构平台</title>
    <script src="/Public/static/jquery-2.0.3.min.js"></script>
    <script src="/Public/static/layer/layer.js"></script>
    <script src="/Public/static/jPages.js"></script>
    <!--内容样式-->
    <link rel="stylesheet" href="__PUBLIC__/Home/css/style.css"/>
    <link rel="stylesheet" href="__PUBLIC__/Home/css/page.css"/>
    <style>
      .holder a {
        border: 1px solid #e1e1e1;
        color: #909090;
        cursor: pointer;
      }


      .jp-current {
        padding: 6px 6px;
        border: 1px solid #e1e1e1;
        background: #f55555;
        cursor: pointer;
      }

      .holder .jp-current {
        color: #fff;
        cursor: pointer;
      }

      .page {
        margin: 0 0 0 0
      }
    </style>
</head>
<body>

<div class="main">
    <!--  头部  -->
    <include file="menu"/>

    <!--  右侧内容  -->
    <div class="content">
        <div class="ct-title">
            <div class="ctt-l">
                <a onclick="switchMenu('')"
                <if condition="$menu eq ''">class="cttl-btn cttl-on"
                    <else/>
                    class="cttl-btn"
                </if>
                >基本信息</a>
                <a onclick="switchMenu('1')"
                <if condition="$menu eq '1'">class="cttl-btn cttl-on"
                    <else/>
                    class="cttl-btn"
                </if>
                >认证信息</a>
                <a onclick="switchMenu('2')"
                <if condition="$menu eq '2'">class="cttl-btn cttl-on"
                    <else/>
                    class="cttl-btn"
                </if>
                >修改密码</a>
                <div class="divclear"></div>
            </div>
            <div class="divclear"></div>
        </div>

        <!-- 基本信息 -->
        <div class="ct-xz" id="jb"
        <if condition="$menu eq ''">style="display: block;"
            <else/>
            style="display: none;"
        </if>
        >
        <form action="{:U('Home/Mechanism/setInfo')}" method="post" class="form-horizontal">
            <div class="ctx-box" style="width: 100%;float: none;">
                <div class="ctxb-l">机构LOGO：</div>
                <input type="file" id="logo_img_file" style="display: none">
                <input type="hidden" name="logo" id="logo" value="{$info.logo}"/>
                <div class="ctxb-r" style="width: 184px;padding: 0;border: 1px dashed #ccc;float: left;margin-right: 10px; position: relative;">
                    <div class="ctxbr-img">
                        <if condition="$info['logo_img'] == ''">
                            <img src="__PUBLIC__/Home/images/img_sctp.png" id="logo_Img"/>
                            <else/>
                            <img src="{$info['logo_img']}" id="logo_Img"/>
                        </if>
                    </div>
                    <div class="ctxbr-sc">
                        <img src="__PUBLIC__/Home/images/icon_sc.png" id="delLogoImg"/>
                    </div>

                    <div style="position: absolute; white-space: nowrap; width: 100%; font-size: 12px; height: 16px; color: #999; text-align: justify; margin: 10 0 0 100px">
                推荐尺寸：184px * 184px
            </div>
                </div>
                <div class="ctxb-sc" id="uploadLogoImg">上传机构LOGO</div>
                <script type="text/javascript">
                    $("#logo_Img").click(function () {
                        $("#logo_img_file").trigger("click");
                    })
                    $('#logo_img_file').change(function () {
                        var pic = $(this)[0].files[0];
                        var formData = new FormData();
                        var url = "{:U('File/uploadPicture',array('session_id'=>session_id()))}";
                        formData.append('download', pic);
                        $.ajax({
                            url: url,
                            type: "post",
                            data: formData,
                            cache: false,
                            contentType: false,
                            processData: false,
                            success: function (data) {
                                //console.log(data);
                                if (data.status == 1) {
                                    //上传成功
                                    var id = data.id;
                                    var path = data.path;

                                    $('#logo').val(id);
                                    $('#logo_Img').attr('src', path);
                                } else {
                                    layer.msg(data.info);
                                }
                            }
                        });
                    });

                    $("#uploadLogoImg").click(function () {
                        $("#logo_img_file").trigger("click");
                    })
                    $('#logo_img_file').change(function () {
                        var pic = $(this)[0].files[0];
                        var formData = new FormData();
                        var url = "{:U('File/uploadPicture',array('session_id'=>session_id()))}";
                        formData.append('download', pic);
                        $.ajax({
                            url: url,
                            type: "post",
                            data: formData,
                            cache: false,
                            contentType: false,
                            processData: false,
                            success: function (data) {
                                //console.log(data);
                                if (data.status == 1) {
                                    //上传成功
                                    var id = data.id;
                                    var path = data.path;

                                    $('#logo').val(id);
                                    $('#logo_Img').attr('src', path);
                                } else {
                                    layer.msg(data.info);
                                }
                            }
                        });
                    });

                    //删除图片
                    $("#delLogoImg").click(function () {
                        $('#logo').val("");
                        $('#logo_Img').attr('src', "__PUBLIC__/Home/images/img_sctp.png");
                        let input = document.getElementById('logo_img_file');
                        input.value = ''
                    })
                </script>
                <div class="divclear"></div>
            </div>
            <div class="ctx-box" style="width: 100%;float: none;">
                <div class="ctxb-l">机构名称：</div>
                <div class="ctxb-r" style="width: 296px;">
                    <input type="text" placeholder="请输入机构名称" class="ctxbr-wb" name="name" value="{$info.name}">
                </div>
                <div class="divclear"></div>
            </div>
            <div class="ctx-box" style="width: 100%;float: none;">
                <div class="ctxb-l">机构介绍：</div>
                <div class="ctxb-r" style="width: 836px;">
                    <textarea placeholder="请输入内容..." class="ctxbr-wbk" name="desc">{$info.desc}</textarea>
                </div>
                <div class="divclear"></div>
            </div>
            <div class="ctx-box" style="width: 100%;float: none;">
                <div class="ctxb-l">banner图：</div>
                <input type="file" id="banner_one_img_file" style="display: none">
                <input type="hidden" name="banner_one" id="banner_one" value="{$info['banners'][0]['id']}"/>
                <div class="ctxb-r" style="width: 318px;padding: 0;border: 1px dashed #ccc;float: left;margin-right: 10px;">
                    <div class="ctxbr-img">
                        <if condition="$info['banners'][0]['img'] == ''">
                            <img src="__PUBLIC__/Home/images/img_sctp.png" id="banner_one_Img"/>
                            <else/>
                            <img src="{$info['banners'][0]['img']}" id="banner_one_Img"/>
                        </if>
                    </div>
                    <div class="ctxbr-sc">
                        <img src="__PUBLIC__/Home/images/icon_sc.png" id="delBannerOneImg"/>
                    </div>
                     <div style="position: absolute; white-space: nowrap; width: 100%; font-size: 12px; height: 16px; color: #999; text-align: justify; margin: 10 0 0 100px">
                推荐尺寸：318px * 184px
            </div>
                </div>

                <script type="text/javascript">
                    $("#banner_one_Img").click(function () {
                        $("#banner_one_img_file").trigger("click");
                    })
                    $('#banner_one_img_file').change(function () {
                        var pic = $(this)[0].files[0];
                        var formData = new FormData();
                        var url = "{:U('File/uploadPicture',array('session_id'=>session_id()))}";
                        formData.append('download', pic);
                        $.ajax({
                            url: url,
                            type: "post",
                            data: formData,
                            cache: false,
                            contentType: false,
                            processData: false,
                            success: function (data) {
                                //console.log(data);
                                if (data.status == 1) {
                                    //上传成功
                                    var id = data.id;
                                    var path = data.path;

                                    $('#banner_one').val(id);
                                    $('#banner_one_Img').attr('src', path);
                                } else {
                                    layer.msg(data.info);
                                }
                            }
                        });
                    });

                    //删除图片
                    $("#delBannerOneImg").click(function () {
                        $('#banner_one').val("");
                        $('#banner_one_Img').attr('src', "__PUBLIC__/Home/images/img_sctp.png");
                        let input = document.getElementById('banner_one_img_file');
                        input.value = ''
                    })
                </script>
               
                
                <input type="file" id="banner_two_img_file" style="display: none">
                <input type="hidden" name="banner_two" id="banner_two" value="{$info['banners'][1]['id']}"/>
                <div class="ctxb-r" style="width: 318px;padding: 0;border: 1px dashed #ccc;float: left;margin-right: 10px;">
                    <div class="ctxbr-img">
                        <if condition="$info['banners'][1]['img'] == ''">
                            <img src="__PUBLIC__/Home/images/img_sctp.png" id="banner_two_Img"/>
                            <else/>
                            <img src="{$info['banners'][1]['img']}" id="banner_two_Img"/>
                        </if>
                    </div>
                    <div class="ctxbr-sc">
                        <img src="__PUBLIC__/Home/images/icon_sc.png" id="delBannerTwoImg"/>
                    </div>
                    <div style="position: absolute; white-space: nowrap; width: 100%; font-size: 12px; height: 16px; color: #999; text-align: justify; margin: 10 0 0 100px">
                推荐尺寸：318px * 184px
            </div>
                </div>
                <script type="text/javascript">
                    $("#banner_two_Img").click(function () {
                        $("#banner_two_img_file").trigger("click");
                    })
                    $('#banner_two_img_file').change(function () {
                        var pic = $(this)[0].files[0];
                        var formData = new FormData();
                        var url = "{:U('File/uploadPicture',array('session_id'=>session_id()))}";
                        formData.append('download', pic);
                        $.ajax({
                            url: url,
                            type: "post",
                            data: formData,
                            cache: false,
                            contentType: false,
                            processData: false,
                            success: function (data) {
                                //console.log(data);
                                if (data.status == 1) {
                                    //上传成功
                                    var id = data.id;
                                    var path = data.path;

                                    $('#banner_two').val(id);
                                    $('#banner_two_Img').attr('src', path);
                                } else {
                                    layer.msg(data.info);
                                }
                            }
                        });
                    });

                    //删除图片
                    $("#delBannerTwoImg").click(function () {
                        $('#banner_two').val("");
                        $('#banner_two_Img').attr('src', "__PUBLIC__/Home/images/img_sctp.png");
                        let input = document.getElementById('banner_two_img_file');
                        input.value = ''
                    })
                </script>

                <input type="file" id="banner_three_img_file" style="display: none">
                <input type="hidden" name="banner_three" id="banner_three" value="{$info['banners'][2]['id']}"/>
                <div class="ctxb-r" style="width: 318px;padding: 0;border: 1px dashed #ccc;float: left;margin-right: 10px;">
                    <div class="ctxbr-img">
                        <if condition="$info['banners'][2]['img'] == ''">
                            <img src="__PUBLIC__/Home/images/img_sctp.png" id="banner_three_Img"/>
                            <else/>
                            <img src="{$info['banners'][2]['img']}" id="banner_three_Img"/>
                        </if>
                    </div>
                    <div class="ctxbr-sc">
                        <img src="__PUBLIC__/Home/images/icon_sc.png" id="delBannerThreeImg"/>
                    </div>
                    <div style="position: absolute; white-space: nowrap; width: 100%; font-size: 12px; height: 16px; color: #999; text-align: justify; margin: 10 0 0 100px">
                推荐尺寸：318px * 184px
            </div>
                </div>
                <script type="text/javascript">
                    $("#banner_three_Img").click(function () {
                        $("#banner_three_img_file").trigger("click");
                    })
                    $('#banner_three_img_file').change(function () {
                        var pic = $(this)[0].files[0];
                        var formData = new FormData();
                        var url = "{:U('File/uploadPicture',array('session_id'=>session_id()))}";
                        formData.append('download', pic);
                        $.ajax({
                            url: url,
                            type: "post",
                            data: formData,
                            cache: false,
                            contentType: false,
                            processData: false,
                            success: function (data) {
                                //console.log(data);
                                if (data.status == 1) {
                                    //上传成功
                                    var id = data.id;
                                    var path = data.path;

                                    $('#banner_three').val(id);
                                    $('#banner_three_Img').attr('src', path);
                                } else {
                                    layer.msg(data.info);
                                }
                            }
                        });
                    });

                    //删除图片
                    $("#delBannerThreeImg").click(function () {
                        $('#banner_three').val("");
                        $('#banner_three_Img').attr('src', "__PUBLIC__/Home/images/img_sctp.png");
                        let input = document.getElementById('banner_three_img_file');
                        input.value = ''
                    })
                </script>

                <div class="ctxb-sc" onClick="showGallery()">选择图库图片上传</div>
                <div class="divclear"></div>
            </div>
            <button class="ctx-btn">保存</button>
        </form>
    </div>


    <!-- 认证信息 -->
    <div class="ct-xz" id="rz"
    <if condition="$menu eq '1'">style="display: block;"
        <else/>
        style="display: none;"
    </if>
    >
    <form action="{:U('Home/Mechanism/setInfo')}" method="post" class="form-horizontal">
        <input type="hidden" name="menu" value="1"/>
        <!-- <div class="ctx-ts">提示：您的营业执照已过期需要重新上传，请及时更新</div> -->
<!--        <div class="ctx-box">
            <div class="ctxb-l">机构名称：</div>
            <div class="ctxb-r">
                <input type="text" placeholder="请输入机构名称" class="ctxbr-wb" name="name" value="{$info.name}">
            </div>
            <div class="divclear"></div>
        </div>-->
        <div class="divclear"></div>
        <div class="ctx-box">
            <div class="ctxb-l">负责人：</div>
            <div class="ctxb-r">
                <input type="text" placeholder="请输入负责人姓名" class="ctxbr-wb" name="username" value="{$info.username}">
            </div>
            <div class="divclear"></div>
        </div>
        <div class="ctx-box">
            <div class="ctxb-l">身份证号：</div>
            <div class="ctxb-r">
                <input type="text" placeholder="请输入负责人身份证号码" class="ctxbr-wb" name="IDcard" value="{$info.idcard}">
            </div>
            <div class="divclear"></div>
        </div>

        <div class="divclear"></div>

        <if condition="$upload_status == 2">
            <div class="ctx-box">
                <div class="ctxb-l">联系手机：</div>
                <div class="ctxb-r">
                    <input type="text" placeholder="请输入负责人联系方式" class="ctxbr-wb mobile" name="mobile" value="{$info.mobile}" readonly>
                </div>
                <div class="divclear"></div>
            </div>
            <else/>
            <div class="ctx-box">
                <div class="ctxb-l">联系手机：</div>
                <div class="ctxb-r" style="width: calc(100% - 316px);">
                    <input type="text" placeholder="请输入负责人联系方式" class="ctxbr-wb mobile" name="mobile" value="{$info.mobile}">
                </div>
                <div class="ctxb-r getCode" style="border: 1px solid #e5e5e5; border-left: 0; text-align: center; width: calc(100% - 408px); font-size: 14px; height: 48px; line-height: 48px; cursor: pointer" onclick="getCode()">获取验证码</div>
                <input type="hidden" class="sms_id" name="sms_id">
                <script>
                    function getCode() {
                        var val = $('.getCode').html();
                        if (val == '获取验证码') {
                            var time = 60;
                            var timer = setInterval(function () {
                                --time;
                                if (time > 0) {
                                    $('.getCode').html(time + 's');
                                } else {
                                    $('.getCode').html('获取验证码');
                                    clearInterval(timer);
                                }
                            }, 1000)

                            var url = "{:U('sendSms')}";
                            var mobile = $('.mobile').val();

                            $.post(url, {
                                mobile: mobile
                            }, function (res) {
                                if (res.result == 1) {
                                    $('.sms_id').val(res.data);
                                } else {
                                    layer.msg(res.msg);
                                }
                            }, 'json')
                        }
                    }
                </script>
                <div class="divclear"></div>
            </div>
            <div class="ctx-box">
                <div class="ctxb-l">验证码：</div>
                <div class="ctxb-r">
                    <input type="text" placeholder="请输入验证码" class="ctxbr-wb" name="code" value="{$info.code}">
                </div>
                <div class="divclear"></div>
            </div>
        </if>


        <div class="divclear"></div>
        <div class="ctx-box">
            <div class="ctxb-l">开户行：</div>
            <div class="ctxb-r">
                <select name="bank_id">
                    <option value="">请选择开户行</option>
                    <volist name="bank_list" id="vo">
                        <option value="{$vo.bank_id}"
                        <if condition="$vo['bank_id'] == $info['bank_id']">selected</if>
                        >{$vo.name}</option>
                    </volist>
                </select>
            </div>
            <div class="divclear"></div>
        </div>
        <div class="ctx-box">
            <div class="ctxb-l">银行卡号：</div>
            <div class="ctxb-r">
                <input type="text" placeholder="请输入银行卡号" class="ctxbr-wb" name="bank_num" value="{$info.bank_num}">
            </div>
            <div class="divclear"></div>
        </div>
        <div class="divclear"></div>
        <div class="ctx-box">
            <div class="ctxb-l">身份证正面：</div>
            <input type="file" id="card_front_file" style="display: none">
            <input type="hidden" name="card_front" id="card_front" value="{$info.card_front}"/>
            <div class="ctxb-r" style="width: calc(100% - 176px);padding: 0;border: 1px dashed #ccc;">
                <div class="ctxbr-img">
                    <if condition="$info['card_front'] == ''">
                        <img src="__PUBLIC__/Home/images/img_sctp.png" id="card_front_Img"/>
                        <else/>
                        <img src="{$info['card_front_path']}" id="card_front_Img"/>
                    </if>
                </div>
                <div class="ctxbr-sc">
                    <img src="__PUBLIC__/Home/images/icon_sc.png" id="delCardFrontImg"/>
                </div>
            </div>
            <script type="text/javascript">
                $("#card_front_Img").click(function () {
                    $("#card_front_file").trigger("click");
                })
                $('#card_front_file').change(function () {
                    var pic = $(this)[0].files[0];
                    var formData = new FormData();
                    var url = "{:U('File/uploadPicture',array('session_id'=>session_id()))}";
                    formData.append('download', pic);
                    $.ajax({
                        url: url,
                        type: "post",
                        data: formData,
                        cache: false,
                        contentType: false,
                        processData: false,
                        success: function (data) {
                            //console.log(data);
                            if (data.status == 1) {
                                //上传成功
                                var id = data.id;
                                var path = data.path;

                                $('#card_front').val(id);
                                $('#card_front_Img').attr('src', path);
                            } else {
                                layer.msg(data.info);
                            }
                        }
                    });
                });

                //删除图片
                $("#delCardFrontImg").click(function () {
                    $('#card_front').val("");
                    $('#card_front_Img').attr('src', "__PUBLIC__/Home/images/img_sctp.png");
                    let input = document.getElementById('card_front_file');
                    input.value = ''
                })
            </script>
            <div class="divclear"></div>
            <div style="width: calc(100% - 176px); font-size: 12px; height: 16px; color: #999; text-align: justify; margin: 10px 0 0 100px">
                上传图片支持 jpg、png格式，图片最大支持200KB，推荐尺寸：324px * 184px
            </div>
        </div>
        <div class="ctx-box">
            <div class="ctxb-l">身份证反面：</div>
            <input type="file" id="card_behind_file" style="display: none">
            <input type="hidden" name="card_behind" id="card_behind" value="{$info.card_behind}"/>
            <div class="ctxb-r" style="width: calc(100% - 176px);padding: 0;border: 1px dashed #ccc;">
                <div class="ctxbr-img">
                    <if condition="$info['card_front'] == ''">
                        <img src="__PUBLIC__/Home/images/img_sctp.png" id="card_behind_Img"/>
                        <else/>
                        <img src="{$info['card_behind_path']}" id="card_behind_Img"/>
                    </if>
                </div>
                <div class="ctxbr-sc">
                    <img src="__PUBLIC__/Home/images/icon_sc.png" id="delCardBehindImg"/>
                </div>
            </div>
            <script type="text/javascript">
                $("#card_behind_Img").click(function () {
                    $("#card_behind_file").trigger("click");
                })
                $('#card_behind_file').change(function () {
                    var pic = $(this)[0].files[0];
                    var formData = new FormData();
                    var url = "{:U('File/uploadPicture',array('session_id'=>session_id()))}";
                    formData.append('download', pic);
                    $.ajax({
                        url: url,
                        type: "post",
                        data: formData,
                        cache: false,
                        contentType: false,
                        processData: false,
                        success: function (data) {
                            //console.log(data);
                            if (data.status == 1) {
                                //上传成功
                                var id = data.id;
                                var path = data.path;

                                $('#card_behind').val(id);
                                $('#card_behind_Img').attr('src', path);
                            } else {
                                layer.msg(data.info);
                            }
                        }
                    });
                });

                //删除图片
                $("#delCardBehindImg").click(function () {
                    $('#card_behind').val("");
                    $('#card_behind_Img').attr('src', "__PUBLIC__/Home/images/img_sctp.png");
                    let input = document.getElementById('card_behind_file');
                    input.value = ''
                })
            </script>
            <div class="divclear"></div>
            <div style="width: calc(100% - 176px); font-size: 12px; height: 16px; color: #999; text-align: justify; margin: 10px 0 0 100px">
                上传图片支持 jpg、png格式，图片最大支持200KB，推荐尺寸：324px * 184px
            </div>
        </div>
        <!--                <div class="ctx-box">
                            <div class="ctxb-l">营业执照：</div>
                            <input type="file" id="business_license_file" style="display: none">
                            <input type="hidden" name="business_license" id="business_license" value="{$info.business_license}"/>
                            <div class="ctxb-r" style="width: calc(100% - 176px);padding: 0;border: 1px dashed #ccc;">
                                <div class="ctxbr-img" style="height: 400px">
                                    <if condition="$info['card_front'] == ''">
                                        <img src="__PUBLIC__/Home/images/img_sctp.png" id="business_license_Img"/>
                                        <else/>
                                        <img src="{$info['business_license_path']}" id="business_license_Img"/>
                                    </if>
                                </div>
                                <div class="ctxbr-sc">
                                    <img src="__PUBLIC__/Home/images/icon_sc.png" id="delBusinessLicenseImg"/>
                                </div>
                            </div>
                            <div class="divclear"></div>
                        </div>
                        <script type="text/javascript">
                            $("#business_license_Img").click(function (){
                                $("#business_license_file").trigger("click");
                            })
                            $('#business_license_file').change(function (){
                                var pic = $(this)[0].files[0];
                                var formData = new FormData();
                                var url="{:U('File/uploadPicture',array('session_id'=>session_id()))}";
                                formData.append('download', pic);
                                $.ajax({
                                    url:url,
                                    type:"post",
                                    data: formData,
                                    cache: false,
                                    contentType: false,
                                    processData: false,
                                    success:function(data){
                                        //console.log(data);
                                        if(data.status == 1){
                                            //上传成功
                                            var id = data.id;
                                            var path = data.path;

                                            $('#business_license').val(id);
                                            $('#business_license_Img').attr('src', path);
                                        }else{
                                            layer.msg(data.info);
                                        }
                                    }
                                });
                            });

                            //删除图片
                            $("#delBusinessLicenseImg").click(function(){
                                $('#business_license').val("");
                                $('#business_license_Img').attr('src', "__PUBLIC__/Home/images/img_sctp.png");
                            })
                        </script>-->
        <div class="divclear"></div>

        <div class="ctx-box">
            <div class="ctxb-l">手持身份证：</div>
            <input type="file" id="hold_card_file" style="display: none">
            <input type="hidden" name="hold_card" id="hold_card" value="{$info.hold_card}"/>
            <div class="ctxb-r" style="width: calc(100% - 176px);padding: 0;border: 1px dashed #ccc;">
                <div class="ctxbr-img">
                    <if condition="$info['hold_card_path'] == ''">
                        <img src="__PUBLIC__/Home/images/img_sctp.png" id="hold_card_img"/>
                        <else/>
                        <img src="{$info['hold_card_path']}" id="hold_card_img"/>
                    </if>
                </div>
                <div class="ctxbr-sc">
                    <img src="__PUBLIC__/Home/images/icon_sc.png" id="delBusinessLicenseImg"/>
                </div>
            </div>
            <div class="divclear"></div>
            <script type="text/javascript">
                $("#hold_card_img").click(function () {
                    $("#hold_card_file").trigger("click");
                })
                $('#hold_card_file').change(function () {
                    var pic = $(this)[0].files[0];
                    var formData = new FormData();
                    var url = "{:U('File/uploadPicture',array('session_id'=>session_id(), 'max_kb' => 200))}";
                    formData.append('download', pic);
                    $.ajax({
                        url: url,
                        type: "post",
                        data: formData,
                        cache: false,
                        contentType: false,
                        processData: false,
                        success: function (data) {
                            //console.log(data);
                            if (data.status == 1) {
                                //上传成功
                                var id = data.id;
                                var path = data.path;

                                $('#hold_card').val(id);
                                $('#hold_card_img').attr('src', path);
                            } else {
                                layer.msg(data.info);
                            }
                        }
                    });
                });

                //删除图片
                $("#delBusinessLicenseImg").click(function () {
                    $('#hold_card').val("");
                    $('#hold_card_img').attr('src', "__PUBLIC__/Home/images/img_sctp.png");
                    let input = document.getElementById('hold_card_file');
                    input.value = ''
                })
            </script>
        </div>
        <div class="divclear"></div>
        <div style="width: calc(100% - 176px); font-size: 12px; height: 16px; color: #999; text-align: justify; margin: 10px 0 0 100px">
            上传图片支持 jpg、png格式，图片最大支持200KB，推荐尺寸：324px * 184px
        </div>
        <if condition="$upload_status != 2">
            <button class="ctx-btn">保存</button>
        </if>
    </form>
</div>

<!-- 修改密码 -->
<div class="ct-xz" id="mm"
<if condition="$menu eq '2'">style="display: block;"
    <else/>
    style="display: none;"
</if>
>
<form action="{:U('Home/Mechanism/setInfo')}" method="post" class="form-horizontal">
    <input type="hidden" name="menu" value="2"/>
    <div class="ctx-box">
        <div class="ctxb-l">原密码：</div>
        <div class="ctxb-r">
            <input type="password" placeholder="请输入原密码" class="ctxbr-wb" name="old_password">
        </div>
        <div class="divclear"></div>
    </div>
    <div class="ctx-box">
        <div class="ctxb-l">新密码：</div>
        <div class="ctxb-r">
            <input type="password" placeholder="请输入新密码" class="ctxbr-wb" name="new_password">
        </div>
        <div class="divclear"></div>
    </div>
    <div class="ctx-box">
        <div class="ctxb-l">确认密码：</div>
        <div class="ctxb-r">
            <input type="password" placeholder="请重复输入新密码" class="ctxbr-wb" name="confirm_password">
        </div>
        <div class="divclear"></div>
    </div>
    <div class="divclear"></div>
    <button class="ctx-btn">确认</button>
</form>
</div>

</div>

</div>


<!-- 选择图片 弹出框-->
<div class="tck-demo" id="tck-xztp">
    <div class="tk-box">
        <div class="tkb-title">
            <div class="tkbt-bt">选择图片</div>
            <div class="tkbt-close" onClick="document.getElementById('tck-xztp').style.display='none'">
                <img src="__PUBLIC__/Home/images/icon_delete.png"/>
            </div>
            <div class="divclear"></div>
        </div>
        <div class="tkb-fpxs">
            <form class="tkbf-top">
                <input type="text" class="tkbft-wb search_name" placeholder="输入图片名称搜索">
                <a class="tkbft-ss" onclick="searchClient()">搜索</a>
                <div class="divclear"></div>
            </form>
            <div class="tkbf-img" id="itemContainer">
                <volist name="gallery" id="vo">
                    <div class="tkbfi-box">
                        <div class="tkbfib-pic">
                            <img src="{$vo.img_path}"/>
                        </div>
                        <div>
                            <div class="tkbfib-bt">{$vo.name}</div>
                        </div>
                        <input type="radio" class="tkbfib-an" name="gallery_id" data-img="{$vo.img_path}" value="{$vo.img}"/>
                    </div>
                </volist>
                <div class="divclear"></div>
            </div>
        </div>


        <!-- 分页 -->
        <div class="tkb-btn" style="width: auto;padding: 0;float: left;margin: 20px 0 0 20px;">
            <div class="page">
                <div class="holder" style="font-size:12px;"></div>
            </div>
        </div>
        <!--<div class="tkb-btn" style="width: auto;padding: 0;float: left;margin: 20px 0 0 20px;">
            <div class="tkbb-an"><</div>
            <div class="tkbb-an tkbb-an-on">1</div>
            <div class="tkbb-an">2</div>
            <div class="tkbb-an">3</div>
            <div class="tkbb-an">></div>
            <div class="divclear"></div>
        </div>-->
        <div class="tkb-qr" style="float: right;margin: 15px 20px 0 0;" onclick="selectGallery()">确定选择</div>
        <div class="divclear"></div>
    </div>

</div>
</body>

<script type="text/javascript">
    function showGallery() {
        $("#tck-xztp").show();
        $("div.holder").jPages({
            containerID: "itemContainer",
            perPage: 8
        });
    }

    /**
     * 搜索图片名称
     * */
    /*var div_node = '';
    function searchClient()
    {
        var name = $('.search_name').val();
        if(div_node == ''){
            div_node = $('.tkbf-img').html();
        }else{
            $('.tkbf-img').html(div_node);
        }
        var divs = $('.tkbf-img > div > div > div > span');
        console.log(divs);
        divs.each(function (index, val){
            var div_html = $(val).html();

            if(div_html.indexOf(name) == -1) {
                console.log($('.tkbf-img > div').eq(index).html());
                //没有搜索到，移除
                $('.tkbf-img > div').eq(index).remove();
                //$(val).remove();
            }
        });
    }*/

    function searchClient() {
        var name = $('.search_name').val();
        var url = "{:U('Home/Mechanism/pictureGalleryList')}";
        $.ajax({
            type: "POST", //类型get，post
            url: url, //链接地址
            data: {"name": name},//参数，一般post用
            success: function (data) {
                var dataObj = JSON.parse(data);
                //console.log(dataObj)
                $('#itemContainer').empty();
                //成功后函数
                if (dataObj.result == 1) {
                    var html = "";
                    for (var i = 0; i < dataObj.data.length; i++) {
                        html += "<div class='tkbfi-box'>" +
                            "<div class='tkbfib-pic'>" +
                            "<img src='" + dataObj.data[i]['img_path'] + "'/></div>" +
                            "<div><div class='tkbfib-bt'>" + dataObj.data[i]['name'] + "</div></div>" +
                            "<input type='radio' class='tkbfib-an' name='gallery_id' data-img='" + dataObj.data[i]['img_path'] + "' value='" + dataObj.data[i]['img'] + "' /></div>";
                    }
                    html += "<div class='divclear'></div>";
                    $('#itemContainer').append(html);

                    $("div.holder").jPages({
                        containerID: "itemContainer",
                        perPage: 8
                    });
                }
            },
            error: function () {
                //失败时函数
                layer.msg("失败");
            }
        })
    }

    function selectGallery() {
        var gallery_id = $("input[name='gallery_id']:checked").val();
        var img_path = $("input[name='gallery_id']:checked").attr('data-img');

        var banner_one = $("#banner_one").val();
        var banner_two = $("#banner_two").val();
        var banner_three = $("#banner_three").val();
        if (banner_one == '') {
            $("#banner_one").val(gallery_id);
            $("#banner_one_Img").attr('src', img_path);
        } else {
            if (banner_two == '') {
                $("#banner_two").val(gallery_id);
                $("#banner_two_Img").attr('src', img_path);
            } else {
                if (banner_three == '') {
                    $("#banner_three").val(gallery_id);
                    $("#banner_three_Img").attr('src', img_path);
                } else {
                    layer.msg("请先删除banner图中的其中一张");
                }
            }
        }
        $('#tck-xztp').hide();
    }

    function switchMenu(menu) {
        if (menu == '1') {
            $("#jb").hide();
            $("#mm").hide();
            $("#rz").show();
        } else if (menu == '2') {
            $("#jb").hide();
            $("#rz").hide();
            $("#mm").show();
        } else {
            $("#rz").hide();
            $("#mm").hide();
            $("#jb").show();
        }
        var url = "{:U('Home/Mechanism/setInfo')}";
        url = url + "&menu=" + menu;
        location.href = url;
    }
</script>
</html>
